<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<jsp:include page="common/header.jsp"></jsp:include>

<link rel="stylesheet" href="${pageContext.request.contextPath}/views/css/styleselector.css" />
<style>
<!--
select {
    border: solid 1px #000;
  
    appearance:none;
    -moz-appearance:none;
    -webkit-appearance:none;

    padding-right: 14px;

    background: url("http://ourjs.github.io/static/2015/arrow.png") no-repeat scroll right center transparent;

}


select::-ms-expand { display: none; }
-->
</style>



<h1>
	<img src="${pageContext.request.contextPath}/views/images/icons/posts.png" alt="" /> 修改管理员信息
</h1>

<div class="bloc">
	<div class="title">编辑用户</div>
	<div class="content">
		<form:form id="login" commandName="userform"  onsubmit="return setsel();"  modelAttribute="userform" action="${pageContext.request.contextPath}/admin-user/formupdate" method="post">
			<input type="hidden" id="substation_id" name="substation_id">
			<form:hidden path="id"/>
			<div class="input">
				<label for="input1">用户名</label>
				<form:input path="username" id="username" /><form:errors path="username" cssClass="formerror"/>
			</div>
			<div class="input">
				<label for="input1">描述信息</label>
				<form:textarea path="description" id="description" /><form:errors path="description" cssClass="formerror" />
			</div>
			<br/>
			<div class="input">
				<label for="input1">手机号</label>
				<form:input path="email" id="email"/><form:errors path="email" cssClass="formerror" />
			</div>
			<div class="input">
				<label for="input1">启用</label>
				<form:checkbox path="status" id="status" value="0"/><form:errors path="status" cssClass="formerror"/>
			</div>
			<%-- <div class="input">
				<label for="input1">启用值</label>
				<form:input path="status" id="statusid" />
			</div> --%>
			<div class="input">
				<label for="input1">角色</label>
			</div>
			<form:select path="roleId" id="roleId" items="${roles }" itemLabel="name" itemValue="id"/><form:errors path="roleId" cssClass="formerror"/>
			
			
			
			
			
			
	
			<div class="submit" style="margin-top: 20px;">
				<input type="submit" value="保存" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="reset" value="取消" class="white" onClick="javascript :history.go(-1);"/>
			</div>
		</form:form>
	</div>
</div>

<script type="text/javascript" src="${pageContext.request.contextPath}/views/js/admin/user_update.js"></script>
<script type="text/javascript">
var curPageName = "admin-user";
changeCurrent();

function setsel(){
	var select1_str = "";
	$("#select2 option").each(function(){
		select1_str = select1_str+$(this).val()+",";
        //alert($(this).text()); //这里得到的就是
    });
	$('#substation_id').val(select1_str);
	
	
	
}



	/* $(function(){
		$("#mobile").val($("#email").val());
		$("#email").remove();
	})
	
	function valMobile(){
		var mobile = $("#mobile").val();
	    //验证手机号
	    var phone_verify = /^1[3|4|5|7|8][0-9]\d{8}$/;
	    if(phone_verify.test(mobile) == false) {
	    	$("#mobile_errors").text("请输入格式正确的手机号");
		}
	} */
</script>